package com.hospital.rank.module.base;

/**
 * 排行类型枚举
 * 0: 医生
 * 1: 板块
 * 2: 帖子
 * 3: 热帖
 * @author yhn
 * @version 1.0
 */
public enum TargetType {
    DOCTOR(0),
    SECTION(1),
    POST(2),
    HOT_POST(3);
    public final Integer value;
    TargetType(Integer value) {
        this.value = value;
    }
    /**
     * 根据值获取枚举对象
     * <br>
     * 默认返回帖子
     */
    public static TargetType getTargetType(Integer value) {
        for (TargetType targetType : TargetType.values()) {
            if (targetType.value.equals(value)) {
                return targetType;
            }
        }
        return POST;
    }
}
